import {configure} from 'mobx';

import {DemoDatas} from "../testing-datas/DemoDatas";
import {HomeStore} from "./HomeStore";
import {PageStore} from "./PageStore";
import {PageEditorStore} from "./PageEditorStore";

configure({isolateGlobalState: true})


// 初始化模拟数据
if (typeof window !== 'undefined' && window.localStorage) {
    const pagesData = window.localStorage.getItem('pages');

    if (!pagesData) {
        let demoDatas = new DemoDatas()
        demoDatas.create()
    }
}

export const homeStore = new HomeStore();
export const pageStore = new PageStore();
export const pageEditorStore = new PageEditorStore();

export default {
    homeStore,
    pageStore,
    pageEditorStore,
}